﻿namespace MelodysDemo.Core.Models
{
    /// <summary>
    /// 答题详情记录表
    /// </summary>
    [Table("survey_answer_detail")]
    [Index("AnswerId", Name = "answer_id")]
    [Index("OptionId", Name = "option_id")]
    [Index("QuestionId", Name = "question_id")]
    public partial class SurveyAnswerDetail
    {
        /// <summary>
        /// 自增主键
        /// </summary>
        [Key]
        [Column("id")]
        public long Id { get; set; }
        /// <summary>
        /// 答题ID
        /// </summary>
        [Column("answer_id")]
        public long AnswerId { get; set; }
        /// <summary>
        /// 问题ID
        /// </summary>
        [Column("question_id")]
        public long QuestionId { get; set; }
        /// <summary>
        /// 选项ID
        /// </summary>
        [Column("option_id")]
        public long OptionId { get; set; }
        /// <summary>
        /// 选项编号
        /// </summary>
        [Column("option_sn")]
        public byte OptionSn { get; set; }
        /// <summary>
        /// 版本号
        /// </summary>
        [Column("version")]
        public long Version { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        [Required]
        [Column("creator")]
        [StringLength(64)]
        public string Creator { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        [Column("modified_time")]
        public DateTime ModifiedTime { get; set; }
        /// <summary>
        /// 修改人
        /// </summary>
        [Required]
        [Column("modifier")]
        [StringLength(64)]
        public string Modifier { get; set; }
        /// <summary>
        /// 是否删除，0：否，1：是
        /// </summary>
        [Column("is_delete")]
        public byte IsDelete { get; set; }

        [ForeignKey("AnswerId")]
        [InverseProperty("SurveyAnswerDetails")]
        public virtual SurveyAnswer Answer { get; set; }
        [ForeignKey("OptionId")]
        [InverseProperty("SurveyAnswerDetails")]
        public virtual SurveyOption Option { get; set; }
        [ForeignKey("QuestionId")]
        [InverseProperty("SurveyAnswerDetails")]
        public virtual SurveyQuestion Question { get; set; }
    }
}